<?php
$this->lang->load('template');
?>
<form action="" method="post">
    <div style="margin:0;padding:0;display:inline">
      <input type="hidden" name="id" value="<?=isset($module['id'])?$module['id']:''?>" />
    </div>
    <p>
      <label for="modulename"><?=$this->lang->line('tpl_modulename')?></label>
      <br />
      <input id="modulename" name="mod_name" size="30" type="text" value="<?=isset($module['mod_name'])?$module['mod_name']:''?>" />
    </p>
    <p>
      <label for="mod_code"><?=$this->lang->line('tpl_modulecode')?></label>
      <br />
      <input id="mod_code" name="mod_code" size="30" type="text" value="<?=isset($module['mod_code'])?$module['mod_code']:''?>" />
    </p>
    <p>
      <label for="mod_desc"><?=$this->lang->line('tpl_moduledesc')?></label>
      <br />
      <input id="mod_desc" name="mod_desc" size="30" type="text" value="<?=isset($module['mod_desc'])?$module['mod_desc']:''?>" />
    </p>
    <p>
      <label for="mod_url"><?=$this->lang->line('tpl_moduleurl')?></label>
      <br />
      <input id="mod_url" name="mod_url" size="30" type="text" value="<?=isset($module['mod_url'])?$module['mod_url']:''?>" />
    </p>
    <p>
      <label for="mod_sorts"><?=$this->lang->line('tpl_sorts')?></label>
      <br />
      <input id="mod_sorts" name="sorts" size="30" type="text" value="<?=isset($module['sorts'])?$module['sorts']:0?>" />
    </p>
    <p>
    <p>
	    <label>上级模块</label>
	    <br />
	    <select name="parent_id" style="width:200px">
	      <option value="0"><?=$this->lang->line('tpl_plsselect')?></option>
	      <?php 
		  foreach($modules as $cate):
		  if( isset($module) && $cate['id']==$module['id'] ){	//删除自己
			  continue;
		  }
		  ?>
	      <option value="<?=$cate['id']?>"  <?php if(isset($module) && $cate['id']==$module['parent_id']):?> selected="selected"<?php endif;?>>
		  <?=str_repeat('--',$cate['level'])?>
		  <?=$cate['mod_name']?></option>
	      <?php endforeach;?>
	    </select>
    </p>
      <label><?=$this->lang->line('tpl_status')?></label>
      <br />
      <label class="sub">
        <input id="mod_status" name="status" type="radio" value="1" checked="checked" />
        <?=$this->lang->line('tpl_on')?></label>
      &nbsp;
      <label class="sub">
        <input id="mod_status_1" name="status" type="radio" value="0"  <?=isset($module['status'])&&$module['status']!="1"?"checked":""?> />
      <?=$this->lang->line('tpl_off')?></label>
      &nbsp; </p>
      </p>
      <label><?=$this->lang->line('tpl_isadmined')?></label>
      <br />
      <label class="sub">
        <input id="mod_admin" name="is_admin" type="radio" value="1" checked="checked" />
        <?=$this->lang->line('tpl_yes')?></label>
      &nbsp;
      <label class="sub">
        <input id="mod_admin_1" name="is_admin" type="radio" value="0"  <?=isset($module['is_admin'])&&$module['is_admin']!="1"?"checked":""?> />
      <?=$this->lang->line('tpl_no')?></label>
      &nbsp; </p>
    <p class="form-buttons">
      <button type="submit"><span><?=$this->lang->line('tpl_submit')?></span></button>
      <a href="<?=getUrl(false);?>"><?=$this->lang->line('tpl_cancel')?></a> </p>
       </p>
  </form>
